package com.iot.iotplus.controller;

import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.iot.iotplus.base.Result;
import com.iot.iotplus.utils.ResultUtil;
import com.iot.iotplus.utils.SendVerificationCodeUtil;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/SendMsg")
@CrossOrigin
public class SendPhoneCodeController {
    @RequestMapping("/{phoneNumber}")
    public Result<?> sendMsg(@PathVariable("phoneNumber") String phoneNumber){
        SendSmsResponse sendSmsResponse = SendVerificationCodeUtil.sendCode(phoneNumber);
        return ResultUtil.success(sendSmsResponse);
    }
}
